<?php
/**
 * Created by JetBrains PhpStorm.
 * User: Bezdelnick
 * Date: 25.04.13
 * Time: 0:39
 * To change this template use File | Settings | File Templates.
 */
require_once("Config.php");
require_once("persistence/Genre.php");
require_once("dao/GenreDao.php");

$genreDao = new GenreDao();

if (isset($_POST['load_by_film_id']))
    $genres = $genreDao->loadByFilmId($_POST['load_by_film_id']);
else
    $genres = $genreDao->load();
?>

<select name="film_genres[]" multiple="multiple" class="jquery-multi-select">
    <? foreach ($genres as $genre) { ?>
    <option value="<?= $genre->getId() ?>" > <?= $genre->getName() ?> </option>
    <? } ?>
</select>